<template>
    <view class="content">
        <van-nav-bar :title="navBarTitle" left-arrow @click-left="onClickLeft"></van-nav-bar>
        <scroll-view class="scroll-content" scroll-y :lower-threshold="80" @scroll="scrollPage" show-scrollbar="false">
            <view class="pageTop">
                <view class="cartAd">
                    <view class="cartAd_title">{{ navBarTitle }}</view>
                </view>
            </view>
            <view class="middle">
           
            </view>
        </scroll-view>
    </view>
</template>
<script>

const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
import {queryCancelAgreementApi} from '@/api/service'
export default {

    components: {
    
    },

    data () {
        return {
            navBarTitle: '取消协议',
            scrolling: false,
            guaranteeTypeMap: {
                'PROPERTY_LOSS': '财产损失保障',
                'SERVICE_ADD': '服务加价保障',
                'REFUND': '随时退·过期退保障',
                'RETURN': '七天无理由退货保障'
            }

        }
    },
    // underlineClicked () {
    //         console.log("下划线文字被点击了");
    //     },
    computed: {},

    watch: {},
    onLoad (option) {
        const guaranteeType = decodeURIComponent(options.guaranteeType || '')
        this.navBarTitle = this.guaranteeTypeMap[guaranteeType] || this.navBarTitle
    },
    onReady () {
    },
    onShow(){
        this.queryCancelAgreement()
    },

    methods: {
        // 滑动
        scrollPage (e) {
            console.log(e.detail.scrollTop, this.scrolling)
            if (e.detail.scrollTop > 25 && !this.scrolling) {
                this.scrolling = true
            } else if ((e.detail.scrollTop <= 25 && this.scrolling) || (e.detail.scrollTop <= 25 && !this.scrolling)) {
                this.scrolling = false
            }
        },
        // 返回键
        onClickLeft () {
            uni.navigateTo({
                url: '/pages/myService/cancelServiceReason'
            })
        },
        // 取消协议
        queryCancelAgreement(){
            queryCancelAgreementApi().then(res=>{
                console.log(res)
            })
        }
        
    }

}
</script>
<style lang="scss" scoped>
// @import '@/styles/variables.scss';

.content {
    background-color: #ffffff;
    display: flex;
    flex-direction:column;
    overflow:hidden;
    box-sizing: border-box;
    height:100vh;
}
.scroll-content {
    flex: 1;
    height: 1px;
}

.pageTop{
    // display: flex;
    // flex-direction: column;
    // background-color: #f9f9f9;
    // padding-bottom: 3px;
}

 // 页面标题部分
 .cartAd {
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 24px 21px 24px ;

}

.cartAd_title {
    font-size: 30px;
    text-align: left;
    line-height: 30px;
    color: #111111;
}
.orderBox{
    background-color: #ffffff;
    display: flex;
    align-items: center;
    padding: 23px 24px 21px 24px ;
}




.middle{
    padding:24px 24px 120px 24px;
}

::v-deep .van-nav-bar__left {
    width: 56px;
    height: 44px;
}

::v-deep .van-icon {
    color: #242629 !important;
}



</style>
